package common;

import java.io.IOException;
import java.util.Properties;

public class ConfigurationAppli {

    private final static String       CONF_FILENAME = "conf.properties";
    private static Properties         properties    = new Properties();
    private static ConfigurationAppli instance;

    private ConfigurationAppli()
    {
        try {
            properties.load( this.getClass().getResourceAsStream( CONF_FILENAME ) );
        } catch ( IOException e ) {
            e.printStackTrace();
        }
    }

    public static ConfigurationAppli getInstance()
    {
        if ( instance == null )
            instance = new ConfigurationAppli();

        return instance;
    }

    public String getValue( String key )
    {
        return (String) ( properties.get( key ) );
    }

}
